<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>D3交互式数据可视化</title>
</head>
<body>
	<ul>
		<li>d3.scale.ordinal() -- 定义一个序数比例尺</li>
		<li>ordinal.domain([values])</li>
		<li>ordinal.range([values])</li>

		<li>ordinal.rangePoints(interval[,padding])</li>
		<li>ordinal.rangeRoundPoints(interval[,padding])</li>

		<li>ordinal.rangeBands(interval[,padding[,outerPadding]])</li>
		<li>ordinal.rangeRoundBands(interval[,padding[,outerPadding]])</li>
		<li>ordinal.rangeBand()</li>
		<li>ordinal.rangeExtend()</li>
		<li>不要输入超出定义域的值</li>
	</ul>
	<script src="js/d3_3.5.7.js"></script>
	<script>
		var ordinal = d3.scale.ordinal()
									.domain([1,2,3,4,5])
									.range([10,20,30,40,50])
		// console.log(ordinal(1))
		// console.log(ordinal(3))
		// console.log(ordinal(5))
		// console.log(ordinal(8))

		var ordinal2 = d3.scale.ordinal()
									.domain([1,2,3,4,5])
									.rangePoints([0,100],5)
		console.log(ordinal2.range())
		console.log(ordinal2(1))
		// console.log(ordinal2(2))


//难点：step =  width/ （array.length - 1 + n）
	</script>
</body>
</html>